package com.explorx.sns.puma.im.core.chat;

import com.explorx.sns.puma.im.core.chat.consts.UserRelationEnum;
import com.explorx.sns.puma.im.core.chat.model.UserRelationModel;
import org.apache.commons.lang3.tuple.Pair;

import java.util.List;

public interface UserRelationService {

    /**
     * 查询两用户之间的好友关系
     * @param from
     * @param to
     * @return
     */
    UserRelationEnum queryUserRelation(Long from, Long to);

    /**
     * 查询某用户的某种类型关系的还有id
     * @param from
     * @param relationEnum
     * @return
     */
    List<UserRelationModel> queryUserIdByRelationType(Long from, UserRelationEnum relationEnum);


    /**
     * 查询当前用户的好友列表
     * @param uid
     * @return
     */
    List<UserRelationModel> queryFriendList(Long uid);


    /**
     * 查询当前用户的联系人列表
     * @param uid
     * @param pageIdx
     * @param pageSize
     * @return
     */
    List<UserRelationModel> queryAllContact(Long uid, Integer pageIdx, Integer pageSize);

    /**
     * 查询被拉黑消息的用户列表
     * @param uid
     * @return
     */
    List<UserRelationModel> queryBlockUserList(Long uid);

    /**
     * 查询用户的的基础信息
     * @param fromUid
     * @param toUid
     * @return
     */
    UserRelationModel queryUserProfile(Long fromUid, Long toUid);

    /**
     * 关注默认
     * @param uid
     * @param targetUid
     * @return
     */
    boolean followUser(Long uid,Long targetUid);

    /**
     * 取关某人
     * @param uid
     * @param targetUid
     * @return
     */
    boolean unfollowUser(Long uid,Long targetUid);

    /**
     * 拉黑某人
     * @param uid
     * @param targetUid
     * @return
     */
    boolean blockUser(Long uid,Long targetUid);

    /**
     * 取消拉黑默认
     * @param uid
     * @param targetUid
     * @return
     */
    boolean unblockUser(Long uid,Long targetUid);

    /**
     * 查询用户的粉丝和关注数
     * @param uid
     * @return
     */
    Pair<Integer,Integer> queryFollowAndFansCnt(Long uid);

}
